Skip to content

Conversation

@jr
Copy link
Collaborator

@jr jr commented Jun 11, 2025

Remove singleton logic from internal cloud services
Cloud: cleanup AuthService

  • Use zod schemas to validate responses
  • Switch to fetch() from axios
  • Remove unused session token parsing from sign in
  • Clear credentials (and logout) if session token response indicates
    invalid/expired client token
  • Add AuthService unit tests

Important

Refactor AuthService, CloudService, and SettingsService to improve authentication handling, replace axios with fetch, and add unit tests.

  • AuthService:
    • Replaced axios with fetch for HTTP requests.
    • Added Zod schemas for response validation in AuthService.ts.
    • Removed singleton pattern from AuthService.
    • Added InvalidClientTokenError to handle invalid/expired tokens.
    • Added unit tests in AuthService.spec.ts.
  • CloudService:
    • Removed singleton pattern from CloudService.
    • Updated to use new AuthService and SettingsService constructors.
  • SettingsService:
    • Removed singleton pattern from SettingsService.
    • Updated to use new AuthService constructor.
  • Misc:
    • Updated vscode mock in __mocks__/vscode.ts to include onDidChange method.
    • Added unit tests for CloudService in CloudService.test.ts.

This description was created by Ellipsis for 1df0fa6. You can customize this summary. It will automatically update as commits are pushed.

@jr jr requested review from cte and mrubens as code owners June 11, 2025 02:37
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Jun 11, 2025
extension: {
packageJSON: {
version: "1.0.0",
publisher: "RooVeterinaryInc",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to continue to use the old name here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That actually still is the value in that field (see

"publisher": "RooVeterinaryInc",
), although in the mock context it's really just an arbitrary string.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jun 12, 2025
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 12, 2025
jr added 2 commits June 18, 2025 13:33
- Use zod schemas to validate responses
- Switch to fetch() from axios
- Remove unused session token parsing from sign in
- Clear credentials (and logout) if session token response indicates
  invalid/expired client token
- Add AuthService unit tests
@jr jr force-pushed the jr/cloud-cleanup branch from ad6ade8 to 1df0fa6 Compare June 18, 2025 22:09
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 19, 2025
@mrubens mrubens merged commit a879f24 into main Jun 19, 2025
15 checks passed
@mrubens mrubens deleted the jr/cloud-cleanup branch June 19, 2025 16:29
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 19, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Jun 19, 2025
cte pushed a commit that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Draft / In Progress size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants